#ifndef BUCKETMETA_H
#define BUCKETMETA_H

#include "../../common/SDS.h"

#define BUCKET_META_PREFIX_PATH             "../data/.mt/buckets/"
#define BUCKET_META_ALONE_FILE_SUFFIX_PATH  "/.metadata/mt.meta"
#define BUCKET_META_GLOBAL_FILE_SUFFIX_PATH ".global/mt.meta"

#define BUCKET_META_1_CREATED_TIME_POS     0
#define BUCKET_META_1_CREATED_TIME_LENGTH  19
#define BUCKET_META_2_ACCESS_POLICY_POS    0 + 19
#define BUCKET_META_2_ACCESS_POLICY_LENGTH 1

int   bucket_global_meta_create_meta();
int   bucket_global_meta_set_str_meta(char *value);
sds  *bucket_global_meta_get_all_buckets(int *bucket_cnt);
int   bucket_meta_create_meta_file(char *bucket);
int   bucket_meta_remove_meta_file(char *bucket);
char *bucket_meta_get_str_meta(char *bucket, char *key);
int   bucket_meta_get_constant_meta(char *bucket, char *key);

#endif // BUCKETMETA_H
